/*
 * sms.h : uRobot Sensor Monitoring Service header.
 * Originally developped for the uRobot project.
 * Parts of the code are originated from GMediaServer from Oskar Liljeblad.
 * Copyright (C) 2011-2012 Seong-Woo Kim <libero@deu.ac.kr>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef SMS_H_
#define SMS_H_

#define SMS_DESCRIPTION \
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" \
"<scpd xmlns=\"urn:schemas-upnp-org:service-1-0\">" \
"  <specVersion>" \
"    <major>1</major>" \
"    <minor>0</minor>" \
"  </specVersion>" \
"  <actionList>" \
"    <action>" \
"      <name>SetFrontLight</name>" \
"      <argumentList>" \
"        <argument>" \
"          <name>Command</name>" \
"          <direction>in</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Command</relatedStateVariable>" \
"          <defaultValue>0</defaultValue>" \
"        </argument>" \
"        <argument>" \
"          <name>Status</name>" \
"          <direction>out</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Status</relatedStateVariable>" \
"        </argument>" \
"      </argumentList>" \
"    </action>" \
"    <action>" \
"      <name>SetFogLight</name>" \
"      <argumentList>" \
"        <argument>" \
"          <name>Command</name>" \
"          <direction>in</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Command</relatedStateVariable>" \
"        </argument>" \
"        <argument>" \
"          <name>Status</name>" \
"          <direction>out</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Status</relatedStateVariable>" \
"        </argument>" \
"      </argumentList>" \
"    </action>" \
"    <action>" \
"      <name>SetBreakLight</name>" \
"      <argumentList>" \
"        <argument>" \
"          <name>Command</name>" \
"          <direction>in</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Command</relatedStateVariable>" \
"        </argument>" \
"        <argument>" \
"          <name>Status</name>" \
"          <direction>out</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Status</relatedStateVariable>" \
"        </argument>" \
"      </argumentList>" \
"    </action>" \
"    <action>" \
"      <name>SetWinkerLight</name>" \
"      <argumentList>" \
"        <argument>" \
"          <name>Command</name>" \
"          <direction>in</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Command</relatedStateVariable>" \
"        </argument>" \
"        <argument>" \
"          <name>Status</name>" \
"          <direction>out</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Status</relatedStateVariable>" \
"        </argument>" \
"      </argumentList>" \
"    </action>" \
"    <action>" \
"      <name>GetFrontDistance</name>" \
"      <argumentList>" \
"        <argument>" \
"          <name>Command</name>" \
"          <direction>in</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Command</relatedStateVariable>" \
"        </argument>" \
"        <argument>" \
"          <name>SensorValue</name>" \
"          <direction>out</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_SensorValue</relatedStateVariable>" \
"        </argument>" \
"      </argumentList>" \
"    </action>" \
"    <action>" \
"      <name>GetBackDistance</name>" \
"      <argumentList>" \
"        <argument>" \
"          <name>Command</name>" \
"          <direction>in</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Command</relatedStateVariable>" \
"        </argument>" \
"        <argument>" \
"          <name>SensorValue</name>" \
"          <direction>out</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_SensorValue</relatedStateVariable>" \
"        </argument>" \
"      </argumentList>" \
"    </action>" \
"    <action>" \
"      <name>GetLeftDistance</name>" \
"      <argumentList>" \
"        <argument>" \
"          <name>Command</name>" \
"          <direction>in</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Command</relatedStateVariable>" \
"        </argument>" \
"        <argument>" \
"          <name>SensorValue</name>" \
"          <direction>out</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_SensorValue</relatedStateVariable>" \
"        </argument>" \
"      </argumentList>" \
"    </action>" \
"    <action>" \
"      <name>GetRightDistance</name>" \
"      <argumentList>" \
"        <argument>" \
"          <name>Command</name>" \
"          <direction>in</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Command</relatedStateVariable>" \
"        </argument>" \
"        <argument>" \
"          <name>SensorValue</name>" \
"          <direction>out</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_SensorValue</relatedStateVariable>" \
"        </argument>" \
"      </argumentList>" \
"    </action>" \
"    <action>" \
"      <name>GetAccelerator</name>" \
"      <argumentList>" \
"        <argument>" \
"          <name>Command</name>" \
"          <direction>in</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Command</relatedStateVariable>" \
"        </argument>" \
"        <argument>" \
"          <name>SensorValue</name>" \
"          <direction>out</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_SensorValue</relatedStateVariable>" \
"        </argument>" \
"      </argumentList>" \
"    </action>" \
"    <action>" \
"      <name>GetSensorInfo</name>" \
"      <argumentList>" \
"        <argument>" \
"          <name>SensorID</name>" \
"          <direction>out</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_SensorID</relatedStateVariable>" \
"        </argument>" \
"        <argument>" \
"          <name>Status</name>" \
"          <direction>out</direction>" \
"          <relatedStateVariable>A_ARG_TYPE_Status</relatedStateVariable>" \
"        </argument>" \
"      </argumentList>" \
"    </action>" \
"  </actionList>" \
"  <serviceStateTable>" \
"    <stateVariable sendEvents=\"no\">" \
"      <name>A_ARG_TYPE_Command</name>" \
"      <dataType>i4</dataType>" \
"      <defaultValue>0</defaultValue>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"no\">" \
"      <name>A_ARG_TYPE_Status</name>" \
"     <dataType>string</dataType>" \
"      <allowedValueList>" \
"        <allowedValue>OK</allowedValue>" \
"        <allowedValue>ContentFormatMismatch</allowedValue>" \
"        <allowedValue>InsufficientBandwidth</allowedValue>" \
"        <allowedValue>UnreliableChannel</allowedValue>" \
"        <allowedValue>Unknown</allowedValue>" \
"      </allowedValueList>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"no\">" \
"      <name>A_ARG_TYPE_SensorValue</name>" \
"      <dataType>string</dataType>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"no\">" \
"      <name>A_ARG_TYPE_SensorID</name>" \
"      <dataType>i4</dataType>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"yes\">" \
"      <name>FrontLight</name>" \
"      <dataType>Boolean</dataType>" \
"      <defaultValue>0</defaultValue>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"yes\">" \
"      <name>FogLight</name>" \
"      <dataType>Boolean</dataType>" \
"      <defaultValue>0</defaultValue>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"yes\">" \
"      <name>BreakLight</name>" \
"      <dataType>Boolean</dataType>" \
"      <defaultValue>0</defaultValue>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"yes\">" \
"      <name>WinkerLight</name>" \
"      <dataType>Boolean</dataType>" \
"      <defaultValue>0</defaultValue>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"yes\">" \
"      <name>FrontDistance</name>" \
"      <dataType>r4</dataType>" \
"      <allowedValueRange>" \
"        <minimum>0.0</minimum>" \
"        <maximum>1000.0</maximum>" \
"      </allowedValueRange>" \
"      <defaultValue>100.0</defaultValue>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"yes\">" \
"      <name>BackDistance</name>" \
"      <dataType>r4</dataType>" \
"      <allowedValueRange>" \
"        <minimum>0.0</minimum>" \
"        <maximum>1000.0</maximum>" \
"      </allowedValueRange>" \
"      <defaultValue>100.0</defaultValue>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"yes\">" \
"      <name>LeftDistance</name>" \
"      <dataType>r4</dataType>" \
"      <allowedValueRange>" \
"        <minimum>0.0</minimum>" \
"        <maximum>1000.0</maximum>" \
"      </allowedValueRange>" \
"      <defaultValue>100.0</defaultValue>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"yes\">" \
"      <name>RightDistance</name>" \
"      <dataType>r4</dataType>" \
"      <allowedValueRange>" \
"        <minimum>0.0</minimum>" \
"        <maximum>1000.0</maximum>" \
"      </allowedValueRange>" \
"      <defaultValue>100.0</defaultValue>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"yes\">" \
"      <name>AcceleratorX</name>" \
"      <dataType>i4</dataType>" \
"      <allowedValueRange>" \
"        <minimum>0</minimum>" \
"        <maximum>1000</maximum>" \
"      </allowedValueRange>" \
"      <defaultValue>0</defaultValue>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"yes\">" \
"      <name>AcceleratorY</name>" \
"      <dataType>i4</dataType>" \
"      <allowedValueRange>" \
"        <minimum>0</minimum>" \
"        <maximum>1000</maximum>" \
"      </allowedValueRange>" \
"      <defaultValue>0</defaultValue>" \
"    </stateVariable>" \
"    <stateVariable sendEvents=\"yes\">" \
"      <name>AcceleratorZ</name>" \
"      <dataType>i4</dataType>" \
"      <allowedValueRange>" \
"        <minimum>0</minimum>" \
"        <maximum>1000</maximum>" \
"      </allowedValueRange>" \
"      <defaultValue>0</defaultValue>" \
"    </stateVariable>" \
"  </serviceStateTable>" \
"</scpd>"

#define SMS_DESCRIPTION_LEN strlen (SMS_DESCRIPTION)

#define SMS_LOCATION "/web/sms.xml"

#define SMS_SERVICE_INDEX 3
#define SMS_SERVICE_ID "urn:upnp-org:serviceId:SensorMonitoring"
#define SMS_SERVICE_TYPE "urn:schemas-upnp-org:service:SensorMonitoring:1"
#define SMS_SERVICE_VARIABLE_COUNT 11


#define SERVICE_SMS_INDEX_FRONT_LIGHT		0
#define SERVICE_SMS_INDEX_FOG_LIGHT		1
#define SERVICE_SMS_INDEX_BREAK_LIGHT		2
#define SERVICE_SMS_INDEX_WINKER_LIGHT		3
#define SERVICE_SMS_INDEX_FRONT_DISTANCE	4
#define SERVICE_SMS_INDEX_BACK_DISTANCE		5
#define SERVICE_SMS_INDEX_LEFT_DISTANCE		6
#define SERVICE_SMS_INDEX_RIGHT_DISTANCE	7
#define SERVICE_SMS_INDEX_ACCELERATOR_X		8
#define SERVICE_SMS_INDEX_ACCELERATOR_Y		9
#define SERVICE_SMS_INDEX_ACCELERATOR_Z		10

#endif /* SMS_H_ */
